﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using AnesSystem.ViewModels;
using AnesSystem.Controls;
using AnesSystem.Models;
using System.Xml;
using AnesSystem.Services;
using Common;

namespace AnesSystem.Controls.CommonTables.CQ.NTZYY
{
    /// <summary>
    /// ZhiKongXingXiCtrl.xaml 的交互逻辑
    /// </summary>
    public partial class ZhiKongXingXiCtrl : BaseTableControl
    {
        public ZhiKongXingXiCtrl()
        {
            InitializeComponent();

            this.DataContext = ZhiKongXingXiViewModel.Instance;
            //Fjhss();
            // zxcc_ZhiKongZhongXing();
            ChangeStewteed();
            this.Loaded += ZhiKongXingXiCtrl_Loaded;
        }

        private void ZhiKongXingXiCtrl_Loaded(object sender, RoutedEventArgs e)
        {
            // FillValue();
            DataManager.Instance.TableHeaderCtrl.ViewModel.DefaultDisplayModel = 1;
        }
        private void ChangeStewteed()
        {
            if (DataManager.Instance.CurrentPatientLink != null)
            {
                double sxpf = DataManager.Instance.CurrentPatientLink.AnesthesiaRecord.Sxpf.ToDouble();
                if (sxpf >= 4)
                {
                    DataManager.Instance.CurrentPatientLink.QualityPojo.Stewardpf = true;
                    //stpf.Value = true;
                }
                else
                {
                    DataManager.Instance.CurrentPatientLink.QualityPojo.Stewardpf = false;
                }
                PatientLinkService.Instance.AddUpdate(DataManager.Instance.CurrentPatientLink);
            }
        }
        //private void Fjhss()
        //{
        //     bool fjhuecsstrue = DataManager.Instance.CurrentPatientLink.AnesthesiaRecord.Fjhss;
        //     bool pojoFjhss=DataManager.Instance.CurrentPatientLink.QualityPojo.Fjhecss;
        //    if (DataManager.Instance.CurrentPatientLink.AnesthesiaRecord!=null&& !fjhuecsstrue)
        //    {
        //        DataManager.Instance.CurrentPatientLink.QualityPojo.Fjhecss = true;
        //    }
        //}
        //private void zxcc_ZhiKongZhongXing()
        //{
        //    bool zxcc = DataManager.Instance.CurrentPatientLink.AnesthesiaRecord.Zxjmcc;
        // bool pojoZxjmcc=DataManager.Instance.CurrentPatientLink.QualityPojo.Zxjmcc;
        //    if (DataManager.Instance.CurrentPatientLink.AnesthesiaRecord!=null&&zxcc)
        //    {
        //        DataManager.Instance.CurrentPatientLink.QualityPojo.Zxjmcc = true;
        //    }
        //}

    }
}
